DIM k AS INTEGER, n AS INTEGER, i AS INTEGER
DIM amin AS SINGLE
INPUT "How Many Elements An Array Has: ", k
DIM a1(k) AS SINGLE
FOR i = 1 TO k
INPUT a1(i)
IF a1(i) >= 0 THEN
n = n + 1
a2(n) = a1(i)
END IF
NEXT i
PRINT
amin = a2(1)
FOR i = 1 TO n - 1
IF a2(i) < amin THEN amin = a2(i)
IF a2(i + 1) < amin THEN amin = a2(i + 1)
NEXT i
FOR i = 1 TO n
PRINT a2(i)
NEXT i
PRINT
PRINT "The Min Value Is: "; amin
END
Тестирование выполнено в программе QB64 ( Скачать )